package com.wgts.wgts.mvp.presenter.imp;

import com.wgts.wgts.mvp.model.IWriteInvitationCodeActivityModel;
import com.wgts.wgts.mvp.presenter.IWriteInvitationCodeActivityPersenter;
import com.wgts.wgts.mvp.view.IWriteInvitationCodeActivityView;
import com.wgts.wgts.netmodle.HttpResultSubscriber;
import com.wgts.wgts.netmodle.req.FireRequest;
import com.wgts.wgts.netmodle.resp.FireEntity;

public class WriteInvitationCodeActivityPersenter implements IWriteInvitationCodeActivityPersenter {

    private IWriteInvitationCodeActivityModel model;

    private IWriteInvitationCodeActivityView view;

    public WriteInvitationCodeActivityPersenter(IWriteInvitationCodeActivityModel model, IWriteInvitationCodeActivityView view) {
        this.model = model;
        this.view = view;
    }


    @Override
    public void fireUser(FireRequest fireRequest) {
        model.fireUser(fireRequest, new HttpResultSubscriber<FireEntity>() {
            @Override
            public void onSuccess(FireEntity fireEntity) {
                view.fireResult(fireEntity);
            }

            @Override
            public void _onError(int status, String msg) {
                view.onError(status, msg);
            }
        });
    }
}
